let obj = new Proxy({}, {
    get(target, propKey, receiver) {
        console.log(`getting ${propKey}`);
        return Reflect
    },
    set(target, propKey, value, receiver) {
        console.log(`setting ${propKey}!`);
        return Reflect.set(target, propKey, value, receiver);
    }
});

const state = new Proxy([], {
  get: (target, propKey, receiver) => {
      if (typeof target[propKey] !== 'function') {
          return Reflect.get(target, propKey, receiver);
      }

      return function(...args) {
          if (args.length > 10) {
              args = args.slice(args.length - 10, args.length);
          }
          if (propKey === 'push' && (target.length + args.length >= 10)) {
              for(let i = 0; i < args.length; i++) {
                  target.shift()
              }
          }
          return Reflect.apply(target[propKey], target, args);
      }
  },
  set: (target, propKey, value, receiver) => {
      // console.log("%c Line:21 🍎 target", "color:#ea7e5c", target, propKey, value);
      if (propKey > 10) {
          return;
      }
      return Reflect.set(target, propKey, value);
  }
});

obj.count = 1;

++obj.count;
